home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / u / utility / packer / autom_pa.ck / de_pack.s next >
Encoding:
Text File  |  1996-11-17  |  3.6 KB  |  154 lines

  1.     LEA    $7000.W,A0        source
  2.     LEA    $7100.W,A1        destination
  3.     BSR    DEPACK2
  4.  
  5. DEPACK2
  6.     LEA 4(A0),A0
  7.     LEA (A0),A4
  8.     MOVE.L    (A0)+,D5
  9.     ADDA.L    D5,A1
  10.     ADDA.L    (A0),A0
  11.     LEA -4(A0),A0
  12.  
  13.     TST.W    -(A0)            Test if it's a dummy.
  14.     BPL.S    L652BC            NO. Valid data.
  15.     LEA -1(A0),A0            Adjust it.
  16.  
  17. L652BC    MOVE.B    -(A0),D0
  18. L652BE    LSL.B    #1,D0
  19.     BNE.S    L652C6
  20.     MOVE.B    -(A0),D0
  21.     ROXL.B    #1,D0
  22. L652C6    BCC.S    L65322            Go do the REPEATS.
  23.  
  24.     CLR.W    D1            Clear size count.
  25.     LSL.B    #1,D0
  26.     BNE.S    L652D2
  27.     MOVE.B    -(A0),D0
  28.     ROXL.B    #1,D0
  29. L652D2    BCC.S    L65316            If ZERO then its a 1 byte repeat
  30.  
  31.     LEA    L6530E(PC),A3        Lower table? BIT sizes.
  32.     MOVEQ    #3,D3            Initial index.
  33. L652DA    CLR.W    D1            Clear size count.
  34.     MOVE.B    0(A3,D3.W),D2        Get the BITsize.
  35.     EXT.W    D2            Clear the crap.
  36.     MOVEQ    #-1,D4            Set all the bits.
  37.     LSL.W    D2,D4            Fill with X zero bits.
  38.     NOT.W    D4            Invert the BITS.
  39.     SUBQ.W    #1,D2            Adjust bit size.
  40.  
  41. L652EA    LSL.B    #1,D0
  42.     BNE.S    L652F2
  43.     MOVE.B    -(A0),D0
  44.     ROXL.B    #1,D0
  45. L652F2    ROXL.W    #1,D1            Collect the size.
  46.     DBF    D2,L652EA
  47.  
  48.     TST.W    D3            ??? No zeroes in the table.
  49.     BEQ.S    L65302
  50.     CMP.W    D1,D4
  51.     DBNE    D3,L652DA
  52. L65302    MOVE.B    4(A3,D3.W),D2        Upper table. ADJUSTMENTS.
  53.     EXT.W    D2            Clear crap.
  54.     ADD.W    D2,D1            Adjust JUNK's count size.
  55.     BRA.s    L65316
  56.  
  57. L6530E    DC.B    $A,3,2,2,$E,7,4,1
  58.  
  59. L65316    MOVE.B    -(A0),-(A1)        Transfer BYTES of junk.
  60.     DBF    D1,L65316
  61.  
  62. L65322    MOVEA.L    A4,A3
  63.     ADDQ.L    #8,A3
  64.     CMPA.L    A3,A0
  65.     BLE    gohome
  66.     LEA    L65368(PC),A3        Little table.
  67.     MOVEQ    #3,D2
  68. L65332    LSL.B    #1,D0
  69.     BNE.S    L6533A
  70.     MOVE.B    -(A0),D0
  71.     ROXL.B    #1,D0
  72. L6533A    BCC.S    L65340
  73.     DBF    D2,L65332
  74.  
  75. L65340    CLR.W    D1
  76.     ADDQ.W    #1,D2
  77.     MOVE.B    0(A3,D2.W),D3        Get the BIT size.
  78.     BEQ.S    L6535C            If ZERO no more bit to collect.
  79.     EXT.W    D3            Clear the crap.
  80.     SUBQ.W    #1,D3            Adjust for looping
  81.  
  82. L6534E    LSL.B    #1,D0
  83.     BNE.S    L65356
  84.     MOVE.B    -(A0),D0
  85.     ROXL.B    #1,D0
  86. L65356    ROXL.W    #1,D1
  87.     DBF    D3,L6534E
  88.  
  89. L6535C    MOVE.B    5(A3,D2.W),D3        Get any ADJUSTMENTS.
  90.     EXT.W    D3
  91.     ADD.W    D3,D1
  92.     BRA.s    L65372            Go to normal REPEAT routine.
  93.  
  94. L65368    DC.B    $A,2,1,0,0,$A,6,4    Little table.
  95.     DC.B    3,2
  96.  
  97. L65372    CMPI.W    #2,D1            2byte repeat.
  98.     BEQ.S    rep            Yeh. Use A3's small table.
  99.     LEA    L653AC(PC),A3        ELSE use the big table.
  100.     MOVEQ    #1,D3            Only two bits to collect.
  101. L6537E    LSL.B    #1,D0
  102.     BNE.S    L65386
  103.     MOVE.B    -(A0),D0
  104.     ROXL.B    #1,D0
  105.  
  106. L65386    BCC.S    L6538C            If first bit zero then leave
  107.     DBF    D3,L6537E
  108. L6538C    ADDQ.W    #1,D3            Adjust index into the table.
  109.     CLR.W    D2            UGH!!
  110.     MOVE.B    0(A3,D3.W),D4        Fetch offset's bitsize.
  111.     EXT.W    D4            Clear the crap.
  112.  
  113. L65396    LSL.B    #1,D0
  114.     BNE.S    L6539E
  115.     MOVE.B    -(A0),D0
  116.     ROXL.B    #1,D0
  117. L6539E    ROXL.W    #1,D2            Collect offset.
  118.     DBF    D4,L65396
  119.     LSL.W    #1,D3            Align with upper table.
  120.     ADD.W    4(A3,D3.W),D2        Add the adjustment to the offset.
  121.     BRA.S    L653DC            Go to MAIN repeat routine.
  122.  
  123. L653AC    DC.B    $B,4,7,0,1,$20        Offset bit sizes.
  124.     DC.B    0,0,0,$20,0,0        Adjustments to the offsets.
  125.  
  126. rep    CLR.W    D2            Clear offset register.
  127.     MOVEQ    #5,D3            SMALL 6bit offset
  128.     CLR.W    D4            Set the ADJUSTER.
  129.     LSL.B    #1,D0
  130.     BNE.S    L653C6
  131.     MOVE.B    -(A0),D0
  132.     ROXL.B    #1,D0
  133. L653C6    BCC.S    L653CC            If CLEAR then small offset.
  134.     MOVEQ    #8,D3            LARGE 9bit offset.
  135.     MOVEQ    #$40,D4            Set the ADJUSTER.
  136.  
  137. L653CC    LSL.B    #1,D0
  138.     BNE.S    L653D4
  139.     MOVE.B    -(A0),D0        Reload the data register.
  140.     ROXL.B    #1,D0            and shift first bit.
  141. L653D4    ROXL.W    #1,D2            Collect the offset.
  142.     DBF    D3,L653CC
  143.  
  144.     ADD.W    D4,D2            Add any ADJUSTER to offset.
  145. L653DC    LEA    0(A1,D2.W),A2        Calc address of repeated string.
  146.     EXT.L    D1            Clear the shit in the LENGTH.
  147.     ADDA.L    D1,A2            LENGTH + address = string end.
  148.     SUBQ.W    #1,D1            Adust LENGTH for looping.
  149. L653E6    MOVE.B    -(A2),-(A1)        Transfer the bytes.
  150.     DBF    D1,L653E6
  151.     BRA    L652BE
  152. gohome    RTS
  153.  
  154.